﻿Imports Microsoft.Xna.Framework.Input
Imports Microsoft.Xna.Framework

Namespace Global.Runa.UI.Input

    Public Class InputManager
        Inherits GameComponent

        Private m_inputHandlers As New List(Of InputHandler)

        ''' <summary>
        ''' Map the specified key with a spcecied function.
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public Property KeyMap() As Dictionary(Of Keys, System.Action(Of Keys))

        Public ReadOnly Property InputHandlers() As List(Of InputHandler)
            Get
                Return Me.m_inputHandlers
            End Get
        End Property

        Public Sub New(ByVal g As Game)
            MyBase.New(g)
        End Sub

        Public Overrides Sub Update(gameTime As Microsoft.Xna.Framework.GameTime)
            For Each ih In Me.InputHandlers
                ih.Update(gameTime)
            Next
            MyBase.Update(gameTime)
        End Sub

    End Class

End Namespace